def str_to_hex(s):
    return ' '.join([hex(ord(c)).replace('0x', '\\u00') for c in s])
    # return ' '.join([hex(ord(c)).replace('0x', '\\x') for c in s])


def get_dict():
    lower_list = list(map(chr, range(ord('A'), ord('z') + 1)))
    letter_dict = {}
    for l in lower_list:
        letter_dict[str_to_hex(l)] = l
    print(letter_dict)
    return letter_dict


# get_dict()
with open(r'D:\python_workspace\my_geetest_crack\ast_js\fullpage.9.0.2.js', encoding='utf8') as f:
    ct = f.read()
l_dict = get_dict()
for k, v in l_dict.items():
    ct = ct.replace(k, v)

with open(r'D:\python_workspace\my_geetest_crack\ast_js\fullpage.9.0.2.easy.js', 'w', encoding='utf8') as fs:
    fs.write(ct)
print('FINISHED!')
